package com.mec.offload.service.impl;


import com.mec.offload.dao.DistanceInfoMapper;
import com.mec.offload.model.DistanceInfo;
import com.mec.offload.service.DistanceInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DistanceInfoServiceImpl implements DistanceInfoService {
    @Autowired
    DistanceInfoMapper distanceInfoMapper;
    public void addDistanceInfo(DistanceInfo info)
    {
        try {
            distanceInfoMapper.addDistanceInfo(info);
        }catch (Exception e){
            e.printStackTrace();
        }

    }
    public List<DistanceInfo> getAllDistanceInfo()
    {
        try {
            return distanceInfoMapper.getAllDistanceInfo();
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }
    public List<DistanceInfo> getDistanceInfoByTermId(Integer id)
    {
        try {
            return distanceInfoMapper.getDistanceInfoByTermId(id);
        }catch (Exception e){
            e.printStackTrace();
        }
        return null;
    }
}

